package oa.hleast.xswl.service.activity;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import oa.hleast.xswl.pojo.domain.activity.CmsUserSignIn;

import java.util.List;

public interface ICmsUserSignInService extends IService<CmsUserSignIn> {

    boolean add(CmsUserSignIn form);

    boolean update(CmsUserSignIn form);

    Page<CmsUserSignIn> pageList(Integer page, Integer limit, String typeName, Integer display);

    boolean deleteByIds(List<String> asList);

    CmsUserSignIn detail(Long id);


    /**
     * 某天某用户的签到情况
     * 没有签到返回 null
     *
     * @param userId     用户ID
     * @param calendarId 日历ID/场次ID
     */
    CmsUserSignIn signInByCalendarAndUserId(Long userId, Long calendarId);

    /**
     * 某场次某用户的是否签到
     *
     * @param userId     用户ID
     * @param calendarId 日历ID/场次ID
     */
    boolean isSignInByCalendarAndUserId(Long userId, Long calendarId);

    /**
     * 某场次的签到人数
     */
    Integer countSignInByCalendar(Long calendarId);
}